import collections


class Solution(object):
    def minimumOperations(self, nums):
        n = len(nums)
        if n == 1:
            return 0
        else:
            c1 = collections.Counter(nums[::2])
            ji_count = (n + 1) // 2
            ou_count = n // 2
            c2 = collections.Counter(nums[1::2])
            t1 = [[c1[key], key] for key in c1]
            t2 = [[c2[key], key] for key in c2]
            t1.sort(reverse=True)
            t2.sort(reverse=True)
            if t1[0][1] != t2[0][1]:
                return ji_count - t1[0][0] + ou_count - t2[0][0]
            else:
                if len(t1) >= 2:
                    if len(t2) >= 2:
                        return min(ji_count - t1[0][0] + ou_count - t2[1][0], ji_count - t1[1][0] + ou_count - t2[0][0])
                    else:
                        return ji_count - t1[1][0] + ou_count - t2[0][0]
                else:
                    if len(t2) >= 2:
                        return ji_count - t1[0][0] + ou_count - t2[1][0]
                    else:
                        return n - max(t1[0][0], t2[0][0])


data = Solution()
nums = [2, 1, 2, 2, 2, 2]
print(data.minimumOperations(nums))
